const express = require('express');
const router = express.Router();
const userRoutes = require('./userRoutes');
const questionRoutes = require('./questionRoutes');
const answerRoutes = require('./answerRoutes');
const categoryRoutes = require('./categoryRoutes');
const pointRoutes = require('./pointRoutes');
const productRoutes = require('./productRoutes');

// 测试路由
router.get('/', (req, res) => {
  res.send('Vue+Vite项目的后端服务正在运行');
});

// 挂载子路由
router.use('/api/users', userRoutes);
router.use('/api/questions', questionRoutes);
router.use('/api/answers', answerRoutes);
router.use('/api/categories', categoryRoutes);
router.use('/api/points', pointRoutes);
router.use('/api/products', productRoutes);

module.exports = router;
